package com.yx.enterresourceplanning.service.serviceImpl;

import com.yx.enterresourceplanning.entity.Dto.UserFormDto;
import com.yx.enterresourceplanning.mapper.UserFromDao;
import com.yx.enterresourceplanning.service.UserFormService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserFormServiceImpl implements UserFormService {
    @Autowired
    private UserFromDao userFromDao;
    @Override
    public List<UserFormDto> getStateFormOfNotTodoByUserId(String userId) {
        //根据用户id获取不是待办的验收单方法。
        return userFromDao.getStateFormOfNotTodoByUserId(userId);
    }

    // 更新用户事项状态
    @Override
    public boolean updateState(String formId, String userId, String state) {
        return userFromDao.updateState(formId, userId, state);
    }

    // 根据用户Id和状态获取不同的表单
    @Override
    public List<UserFormDto> getDiffFormByUserIdAndState(String userId, String state) {
        return userFromDao.getDiffFormByUserIdAndState(userId, state);
    }
    // 根据用户Id和表单Id获取状态
    @Override
    public Integer getStateByUserIdAndFormId(String userId, String formId) {
        return userFromDao.getStateByUserIdAndFormId(userId, formId);
    }


}
